package cn.regexp.seckill.feign.fallback;

import cn.regexp.common.core.domain.Product;
import cn.regexp.common.core.web.Result;
import cn.regexp.seckill.feign.ProductFeignApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

/**
 * @author Regexpei
 * @date 2024/7/5 23:20
 * @description 商品feign服务降级
 */
@Slf4j
@Component
public class ProductFeignFallback implements ProductFeignApi {
    @Override
    public Result<List<Product>> queryProductByIds(List<Long> ids) {
        log.error("调用 lego-shop-service-product 服务异常，进入降级方法");
        return Result.success(Collections.emptyList());
    }
}
